<div class="stages view">
<h2><?php  echo __($stage['Stage']['name']); ?></h2>
	<dl>

		<dt><?php echo __('Descripción'); ?></dt>
		<dd>
			<?php echo h($stage['Stage']['description']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Fecha Inicio'); ?></dt>
		<dd>
			<?php echo h($stage['Stage']['init_date']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Fecha Termino'); ?></dt>
		<dd>
			<?php echo h($stage['Stage']['finish_date']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Proyectos'); ?></dt>
		<dd>
			<?php echo $this->Html->link($stage['Project']['name'], array('controller' => 'projects', 'action' => 'view', $stage['Project']['id'])); ?>
			&nbsp;
		</dd>
	</dl>

	<div class="related">
	<h3><?php $stage['Presentation'];echo __('Entregas Del Proyecto'); ?></h3>
	<?php if (!empty($stage['Presentation'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Nombre'); ?></th>
		<th><?php echo __('Fecha Inicio'); ?></th>
		<th><?php echo __('Fecha Final'); ?></th>
		<th><?php echo __('Tipo'); ?></th>
		<th class="actions"><?php echo __('Acciones'); ?></th>
	</tr>
	<?php
		$i = 0;
		
		foreach ($stage['Presentation'] as $presentation): ?>
		<tr>
			<td>
			<?php echo $this->Html->link($presentation['name'], array('controller' => 'presentations', 'action' => 'view', $presentation['id'])); ?>
		</td>
			<td><?php echo $presentation['startdate']; ?></td>
			<td><?php echo $presentation['enddate']; ?></td>
			<td><?php if($presentation['presentation_type_id']==1)echo "Final";
				  if($presentation['presentation_type_id']==2)echo "Avance";			
			 ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('Editar'), array('controller' => 'presentations', 'action' => 'edit', $presentation['id'])); ?>
				<?php echo $this->Form->postLink(__('Eliminar'), array('controller' => 'presentations', 'action' => 'delete', $presentation['id']), null, __('Estas Seguro de Eliminar Avance del Proyecto # %s?', $presentation['id'])); ?>
			</td>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Form->postLink(__('Nueva Entrega'), array('action' => 'addPresentation',$stage['Stage']['id'])); ?> </li>
		</ul>
	</div>
</div>
</div>
<div class="actions">
	<h3><?php echo __('Acciones'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Editar Etapa'), array('action' => 'edit', $stage['Stage']['id'])); ?> </li>
		<!--li><?php echo $this->Form->postLink(__('Eliminar Etapa'), array('action' => 'delete', $stage['Stage']['id']), null, __('Are you sure you want to delete # %s?', $stage['Stage']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Etapas'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nueva Etapa'), array('action' => 'add')); ?> </li-->
		<li><?php echo $this->Html->link(__('Listar Proyectos'), array('controller' => 'projects', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nuevo Proyecto'), array('controller' => 'projects', 'action' => 'add')); ?> </li>
	</ul>
</div>

